home *** CD-ROM | disk | FTP | other *** search
/ PC Open 96 / PC Open 96 CD3.bin / fscommand / index.swf / scripts / DefineSprite_66 / frame_1 / DoAction_3.as < prev    next >
Encoding:
Text File  |  2004-01-08  |  3.3 KB  |  143 lines

  1. function traguardi()
  2. {
  3.    var a;
  4.    var i;
  5.    var cont = 0;
  6.    i = 0;
  7.    while(i < this.n.length)
  8.    {
  9.       var name = "oggetto" + i;
  10.       if(i > this.tasto)
  11.       {
  12.          this.traguardo[i] = (i + this.n[this.tasto]) * 11 + 1;
  13.          a = cont;
  14.          while(a < cont + this.n[i])
  15.          {
  16.             this.traguardof[a] = this.traguardo[i];
  17.             a++;
  18.          }
  19.          cont = a;
  20.       }
  21.       else if(i < this.tasto)
  22.       {
  23.          this.traguardo[i] = this.inizio[i];
  24.          a = cont;
  25.          while(a < cont + this.n[i])
  26.          {
  27.             this.traguardof[a] = this.traguardo[i];
  28.             a++;
  29.          }
  30.          cont = a;
  31.       }
  32.       else if(i == this.tasto)
  33.       {
  34.          this.traguardo[i] = this.inizio[i];
  35.          a = cont;
  36.          while(a < cont + this.n[i])
  37.          {
  38.             if(a == cont)
  39.             {
  40.                var prima = a - 1;
  41.             }
  42.             this.traguardof[a] = 11 * (a - prima) + this.traguardo[i];
  43.             a++;
  44.          }
  45.          cont = a;
  46.       }
  47.       i++;
  48.    }
  49. }
  50. function spegni()
  51. {
  52.    i = 0;
  53.    while(i < this.n.length)
  54.    {
  55.       this["oggetto" + i].gotoAndStop(1);
  56.       i++;
  57.    }
  58.    this.spegni1();
  59. }
  60. function spegni1()
  61. {
  62.    i = 0;
  63.    while(i < this.fields.length)
  64.    {
  65.       this["oggettonuovo" + i].gotoAndStop(1);
  66.       i++;
  67.    }
  68. }
  69. function chiudi()
  70. {
  71.    var cont = 0;
  72.    var a;
  73.    i = 0;
  74.    while(i < this.n.length)
  75.    {
  76.       this["oggetto" + i].gotoAndStop(1);
  77.       this.traguardo[i] = this.inizio[i];
  78.       a = cont;
  79.       while(a < cont + this.n[i])
  80.       {
  81.          this.traguardof[a] = this.traguardo[i];
  82.          this["oggettonuovo" + a].gotoAndStop(1);
  83.          a++;
  84.       }
  85.       cont = a;
  86.       i++;
  87.    }
  88. }
  89. function init()
  90. {
  91.    for(var sName in this)
  92.    {
  93.       if(this[sName]._parent == this && sName != "clip" && sName != "clip1")
  94.       {
  95.          this[sName].removeMovieClip();
  96.       }
  97.    }
  98.    this.traguardo = new Array(this.n.length);
  99.    this.traguardof = new Array(this.linkArr.length);
  100.    this.inizio = new Array(this.n.length);
  101.    clip._visible = false;
  102.    clip1._visible = false;
  103.    if((this.titoli.length + this.fields.length) * 11 > 304)
  104.    {
  105.       this._yscale = 304 / ((this.titoli.length + this.fields.length) * 11) * 100;
  106.    }
  107.    else
  108.    {
  109.       this._yscale = 105;
  110.    }
  111.    var cont = 0;
  112.    var i = 0;
  113.    while(i < this.n.length)
  114.    {
  115.       var name = "oggetto" + i;
  116.       this.clip.duplicateMovieClip(name,++this.depth + 100);
  117.       this.traguardo[i] = i * 11 + 1;
  118.       this.inizio[i] = i * 11 + 1;
  119.       this[name].tasto = i;
  120.       this[name]._y = i * 11 + 1;
  121.       this[name].title = this.titoli[i];
  122.       a = cont;
  123.       while(a < cont + this.n[i])
  124.       {
  125.          var name1 = "oggettonuovo" + a;
  126.          this.clip1.duplicateMovieClip(name1,++this.depth);
  127.          this.traguardof[a] = i * 11 + 1;
  128.          this[name1]._y = this.traguardo[i];
  129.          this[name1].field = a;
  130.          this[name1].url = this.linkArr[a].url;
  131.          this[name1].title = this.linkArr[a].title;
  132.          this[name1].fileType = this.linkArr[a].fileType;
  133.          a++;
  134.       }
  135.       cont = a;
  136.       i++;
  137.    }
  138.    this.tasto = 0;
  139.    this.traguardi();
  140.    this.spegni();
  141.    this.oggetto0.gotoAndStop(5);
  142. }
  143.